package com.sdk.ks;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class KSResponse {
   public String dataList;
   private Integer result;
   private String errorMsg;
   private String data;
   @JsonProperty("access_token")
   private String accessToken;
   @JsonProperty("expires_in")
   private Long expiresIn;
   @JsonProperty("token_type")
   private String tokenType;

   public void check() {
      if (this.result != 1) {
         throw new RuntimeException(this.errorMsg);
      }
   }
}
